<template>
  <div>
    <div style="text-align:left">
      患者信息：
      <el-tag>姓名：{{patient.real_name}}</el-tag>
      <el-tag>病历号：{{patient.case_number}}</el-tag>
      <el-tag>年龄：{{patient.age}}</el-tag>
      <el-tag>性别：{{patient.gender}}</el-tag>
    </div>
    <el-divider></el-divider>
    <div style="font-size:20px;text-align:left">
      <i class="el-icon-document-checked">处置申请</i>
    </div>
    <el-divider></el-divider>
    
    <div style="display:flex;">
    <el-button type="primary" disabled icon="el-icon-price-tag">项目金额：{{total_price}}元</el-button>
    </div>
    <el-table :data="check_request_table" style="width:80%" @selection-change="checkSelectionChange">
        <el-table-column type="selection" width="55"></el-table-column>
        <el-table-column prop="tech_code" label="处置编码" width="180"></el-table-column>
        <el-table-column prop="tech_name" label="处置名称" ></el-table-column>
        <el-table-column prop="tech_format" label="处置规格" width="100"></el-table-column>
        <el-table-column prop="tech_price" label="单价" width="100"></el-table-column>
        <el-table-column prop="price_type" label="费用分类" width="100"></el-table-column>
        <el-table-column width="180">
          <template slot="header" slot-scope="scope">
            <el-button type="text" @click="delCheck()">删除</el-button>
            <el-button type="text" @click="checkDialogTableVisible=true">增加</el-button>
          </template>
        </el-table-column>
    </el-table>
    <el-descriptions title="医嘱" :column="1" border style="width:80%;margin-top:20px">
      <el-descriptions-item label="目的要求：" :labelStyle="{'width':'120px'}">
        <el-input type="textarea" :rows="4" v-model="check_info" placeholder="请输入检验目的要求"></el-input>
      </el-descriptions-item>
      <el-descriptions-item label="检验部位：" :labelStyle="{'width':'120px'}">
        <el-input type="textarea" :rows="2" v-model="check_position" placeholder="请输入检验部位"></el-input>
      </el-descriptions-item>
      <el-descriptions-item label="备注：" :labelStyle="{'width':'120px'}">
        <el-input type="textarea" :rows="4" v-model="check_remark" placeholder="请输入检验事项"></el-input>
      </el-descriptions-item>
    </el-descriptions>
    <!-- 处置项目选择对话框 -->
    <el-dialog title="添加处置申请" :visible.sync="checkDialogTableVisible">
      <div>
        <el-tag style="width:20%">处置编码：</el-tag><el-input style="width:80%" v-model="checkRequest.tech_code" placeholder="请输入处置编码"></el-input>
      </div>
      <div>
        <el-tag style="width:20%">处置名称：</el-tag><el-input style="width:80%" v-model="checkRequest.tech_name" placeholder="请输入处置名称"></el-input>
      </div>
      <div style="float:right">
        <el-button @click="searchCheck()">搜索</el-button>
      </div>
      <el-table :data="search_check" @selection-change="checkSelectionChange">
        <el-table-column type="selection" width="55"></el-table-column>
        <el-table-column property="tech_code" label="处置编码" width="150"></el-table-column>
        <el-table-column property="tech_name" label="处置名称" ></el-table-column>
        <el-table-column prop="tech_format" label="处置规格" width="100"></el-table-column>
        <el-table-column prop="tech_price" label="单价" width="100"></el-table-column>
        <el-table-column prop="price_type" label="费用分类" width="100"></el-table-column>
      </el-table>
      <div>
        <el-button type="primary" @click="addSelectionCheck()">添加</el-button>
        <el-button type="info" @click="checkDialogTableVisible=false">关闭</el-button>
      </div>
    </el-dialog>

    <el-divider></el-divider>
    <div style="text-align:left;margin-top:20px">
        <el-button type="primary" @click="addCheckRequest()">申请提交</el-button>
        <el-button type="primary" @click="clearCheckRequest()">清空表格</el-button>
    </div>
    
  </div>
</template>
<script>
import {isNullMessage} from "../../../util/util"
import qs from 'qs'
export default {
  data(){
    return{
      submit_check_info:{},//保存提交信息
      check_info:'',
      check_position:'',
      check_remark:'',
      total_price:0,//申请处置项目总金额
      temp_check:[],
      checkDialogTableVisible:false,//设置处置项目选择对话框是否显示
      patient:{}, //患者信息
      check_request_table:[],//处置申请项
      checkRequest:{},//处置项目选择对话框提交搜索数据
      search_check:[],//table的处置数据
    }    
  },
  methods:{

  },
  mounted() {
  }
}
</script>
